package com.teemo.equipment.biz.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.teemo.equipment.biz.EquipmentBizService;
import com.teemo.equipment.converter.EquipmentMapStruct;
import com.teemo.equipment.domain.dto.EquipmentPageDTO;
import com.teemo.equipment.domain.entity.Equipment;
import com.teemo.equipment.domain.vo.BasePageVO;
import com.teemo.equipment.domain.vo.EquipmentPageVO;
import com.teemo.equipment.service.EquipmentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author Teemo
 */
@Service
public class EquipmentBizServiceImpl implements EquipmentBizService {

    @Resource
    private EquipmentService equipmentService;
    @Override
    public BasePageVO<EquipmentPageVO> page(EquipmentPageDTO dto) {
        Page<Equipment> page = equipmentService.pageQuery(dto);
        BasePageVO<EquipmentPageVO> result = BasePageVO.convert(page, EquipmentMapStruct.INSTANCE::toEquipmentPageVO);
        return result;
    }
}
